﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ue.Framework.Data;
using Ue.Infrastructure.EntityFactoryFramework;
using Ue.Qcdz.Domain.SaleCategorys;
namespace Ue.Qcdz.Repositories.SaleCategorys
{
    public class SaleCategryFactory : IEntityFactory<SaleCategory>
    {

        internal class FieldNames : FieldNamesBase
        {
            public const string Name = "Name";
            public const string ShopId = "ShopId";
            public const string Code = "Code";
            public const string Remark = "Remark";
            public const string DisplayOrder = "DisplayOrder";
            public const string Status = "Status";
        }


        #region IEntityFactory<SaleCategory> 成员

        public SaleCategory BuildEntity(System.Data.IDataReader reader)
        {
            return new SaleCategoryFroxy(
              reader.Get<Guid>(SaleCategryFactory.FieldNames.EntityKey),
              reader.Get<string>(SaleCategryFactory.FieldNames.Name),
              reader.Get<string>(SaleCategryFactory.FieldNames.Code),
              reader.Get<string>(SaleCategryFactory.FieldNames.Remark),
              reader.Get<int>(SaleCategryFactory.FieldNames.DisplayOrder),
              reader.Get<int>(SaleCategryFactory.FieldNames.Status),
              reader.Get<DateTime>(SaleCategryFactory.FieldNames.CreateOn)
          );
        }

        #endregion
    }
}
